package com.yc.shopping.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.yc.shopping.util.DBHelper;

public class GoodTypeDao {

	/*
	 * 查看所有商品类型
	 */
	
	public List<Map<String,Object>> findAll() throws SQLException{
		String sql = "select tid,tname,tstatus from tb_goodtype order by tid asc";
		return DBHelper.selectListMap(sql);
	}
	
	/*
	 * 添加商品类型
	 */
	
	public int add(String name) throws SQLException {
		String sql = "insert into tb_goodtype values(seq_100_tid.nextval,?,1)";
		return DBHelper.update(sql, name);
	}
}
